
clear; clc;
addpath(fullfile(pwd, '..', 'lib'));
dataName ={ 'bbcnewssport_737n_1000d_5c_uni_12k','RELATHE_1427n_4322d_2c_tfidf_uni_12k',...
    'warpPIE10P_210n_2420d_10c_12k','COIL20_1440n_1024d_20c_uni_12k',...
    'UMIST_575n_644d_20c_12k','BASEHOCK_1993n_4862d_2c_tfidf_uni_12k',...
     'leukemia_72n_7070d_2c_12k','ALLAML_72n_7129d_2c_12k',...   
};
for i1 =1:length(dataName)

    load(fullfile(pwd, '..', 'data', dataName{i1}));
    Ks2 = zeros(size(Ks));
    for i2 = 1:size(Ks,3)
        Ktmp = knorm(Ks(:,:,i2));
        if max(Ktmp(:)) > 1
            Ktmp = Ktmp  / max(Ktmp(:));
        end
        Ks2(:,:,i2) = Ktmp;
    end
    clear Ks;
    nRepeat = 1;
    [res_crsc_aio, timeElapsed1, res_crsc,biaozhuncha,fangcha] = CRSC_single_dataset(Ks2, Y, nRepeat);
   save(['..\','metricresult\',dataName{i1}, '_crsc.mat'],  'res_crsc','res_crsc_aio','timeElapsed1','fangcha','biaozhuncha');
  save([dataName{i1}, '_crsc.mat'],  'res_crsc','res_crsc_aio','timeElapsed1','fangcha','biaozhuncha');

end